package com.java.singleton;

/**
 * @Author: TongRui乀
 * @Date: 2019/3/5 14:55
 * @description： 懒汉式 双层Null判断
 */
public class LazySingletonNull {

    private LazySingletonNull(){}

    private static volatile  LazySingletonNull instance = null;


    public static LazySingletonNull getInstance(){

        if(instance != null){

            synchronized (LazySingletonNull.class){

                if(instance != null){

                    instance = new LazySingletonNull();
                }
            }
        }
        return instance;
    }

}
